package com.joysuch.wwyt.workflow.utils;

import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.joysuch.wwyt.core.enums.Status;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.workflow.WorkFlowConstants;
import com.joysuch.wwyt.workflow.service.WorkFlowTaskProcessListService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;

import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Slf4j
public class PrintTemplateContentFillUtil {

    @Autowired
    private WorkFlowTaskProcessListService workFlowTaskProcessListService;
    
    private static String getSubUtil(String soap) {
        if (StringUtils.isNotBlank(soap)) {
            String regex = "\\$\\{(.*?)\\}";
            Pattern pattern = Pattern.compile(regex);
            Matcher matcher = pattern.matcher(soap);
            int i = 1;
            if (matcher.find()) {
                return matcher.group(i);
            }
        }
        return soap;
    }

    /**
     * 打印模板数据填充
     *
     * @param templateStr
     * @param formData
     * @return
     * @throws ApiBusinessException
     */
    public static JSONObject printTemplateDataFill(String templateStr, String formData , String processFromJson) throws ApiBusinessException {
        
        JSONObject templateJson = JSON.parseObject(templateStr);
        JSONObject rows = (JSONObject) templateJson.get("rows");
        generateFormData(rows, formData);
        Map<String, Queue<Map<String, String>>> labelMap = buildRowLabelsMap(rows);
        buildTableRowsData(labelMap, formData);
        int tableRealindex = 0;
        int tableTrendindex = 0;
        for (Map.Entry<String, Object> each : rows.entrySet()) {
            Object val = each.getValue();
            JSONObject row = (JSONObject) val;
            JSONObject cells = (JSONObject) row.get("cells");
            String type = row.get("type") != null ? row.get("type").toString() : "";
            Map<String, String> mk = null;
            for (Map.Entry<String, Object> cell : cells.entrySet()) {
                Object content = cell.getValue();
                JSONObject contentJson = (JSONObject) content;
                String keyValue = (String) contentJson.get("key");
                String textValue = (String)contentJson.get("text");
                if (StringUtils.isNotBlank(keyValue)) {
                    //标题不需要替换，标题的key为空
                    JSONObject fromJson = JSON.parseObject(formData);
                    String value = fromJson.get(keyValue) != null ? JSON.toJSONString(fromJson.get(keyValue)) : "";
                    //是表格
                    if (type.equals("table")) {
                        //找到text然后去外壳
                        String lable = textValue.substring(2, textValue.length() - 1);
                        //再从columnList中找到对应lable
                        String accessTypeValue = findObjectFormJsonComponentType(processFromJson, keyValue, lable);
                        //判断是否拿到lable对应的accessType
                        if (StringUtils.isNotBlank(accessTypeValue)){
                            List<String> lableValueList = getLableValueFromData(value, lable);
                            if ("实时值".equals(accessTypeValue)){
                                contentJson.put("mpType","realtime");
                                if (CollectionUtils.isNotEmpty(lableValueList)){
                                    contentJson.put("text",lableValueList.get(tableRealindex));
                                    tableRealindex = tableRealindex + 1;
                                }else {
                                    contentJson.put("text",lableValueList);
                                }
                            }else if ("历史趋势".equals(accessTypeValue)){
                                contentJson.put("mpType","name");
                                if (CollectionUtils.isNotEmpty(lableValueList)){
                                    contentJson.put("text",lableValueList.get(tableTrendindex));
                                    tableTrendindex = tableTrendindex + 1;
                                }else {
                                    contentJson.put("text",lableValueList);
                                }
                            }
                        }else {
                            Queue<Map<String, String>> mapQueue = labelMap.get(each.getKey().concat("_".concat(keyValue)));
                            if (MapUtils.isEmpty(mk) && mapQueue != null) {
                                mk = mapQueue.poll();
                            }
                            if (mk != null) {
                                String text = getSubUtil((String) contentJson.get("text"));
                                contentJson.put("text", mk.get(text));
                                mk.remove(text);
                            } else {
                                contentJson.put("text", "");
                            }
                        }
                    } else {
                        if ("monitorPoint".equals(contentJson.get("componentType"))){
                            Object key = contentJson.get("key");
                            String special = findObjectFormJsonComponentType(processFromJson, key.toString());
                            JSONObject specialValue = JSON.parseObject(special);
                            if (null != specialValue){
                                JSONObject monitorePointValue = JSONObject.parseObject(specialValue.get("monitorePoint").toString());
                                String accessType = (String) monitorePointValue.get("accessType");
                                if (StringUtils.isNotBlank(accessType)){
                                    if ("实时值".equals(accessType)){
                                        contentJson.put("mpType","realtime");
                                        contentJson.put("text",value);
                                    } else if ("历史趋势".equals(accessType)) {
                                        contentJson.put("mpType","name");
                                        contentJson.put("text",value);
                                    }
                                }
                            }else {
                                    contentJson.put("text", value);
                            }
                        }else {
                            contentJson.put("text", value);
                        }
                    }
                }
            }
        }
        return rows;
    }

    /**
     * 构建数组类型label对应的数据
     *
     * @param labelQueue
     * @param formData
     */
    public static void buildTableRowsData(Map<String, Queue<Map<String, String>>> labelQueue, String formData) {
        Map<String, Queue<JSONObject>> dataMap = buildArrayDataMap(formData);
        labelQueue.forEach((k, v) -> {
            int index = k.indexOf("_");
            String key = k.substring(index + 1);
            Queue<JSONObject> queue = dataMap.get(key);
            if (CollectionUtils.isNotEmpty(v) && queue != null && !queue.isEmpty()) {
                v.forEach(each -> {
                    JSONObject jsonObject = queue.poll();
                    each.forEach((label, value) -> {
                        if (jsonObject != null && jsonObject.get(label) != null) {
                            each.put(label, jsonObject.get(label).toString());
                        }
                    });
                });
            }
        });
    }

    /**
     * 构建数组类型的数据队列
     *
     * @param formData
     * @return
     */
    public static Map<String, Queue<JSONObject>> buildArrayDataMap(String formData) {
        Map<String, Queue<JSONObject>> dataMap = new LinkedHashMap<>();
        JSONObject fromJson = JSON.parseObject(formData);
        for (Map.Entry<String, Object> each : fromJson.entrySet()) {
            Queue<JSONObject> queue = new LinkedList<>();
            if (JSONUtil.isJsonArray(each.getValue().toString())) {
                JSONArray jsonArray = JSON.parseArray((each.getValue().toString()));
                for (Object json : jsonArray) {
                    if (JSONUtil.isJsonObj(json.toString())) {
                        queue.offer(JSON.parseObject(json.toString()));
                    }
                }
                if (!queue.isEmpty()) {
                    dataMap.put(each.getKey(), queue);
                }
            }
        }
        return dataMap;
    }

    /**
     * 构建需要动态增加的行的信息
     *
     * @param rows
     * @param formData
     * @return
     * @throws ApiBusinessException
     */
    public static Map<Integer, Integer> buildNeedAddRowMap(JSONObject rows, String formData) throws ApiBusinessException {
        Map<Integer, Integer> rowArrayDataMap = new LinkedHashMap<>();
        for (Map.Entry<String, Object> e : rows.entrySet()) {
            String k = e.getKey();
            Object v = e.getValue();
            if (JSONUtil.isJson(v.toString())) {
                JSONObject row = (JSONObject) v;
                JSONObject cells = (JSONObject) row.get("cells");
                String type = row.get("type") != null ? row.get("type").toString() : "";
                if (cells != null) {
                    Set<String> keySet = new HashSet<>();
                    for (Map.Entry<String, Object> entry : cells.entrySet()) {
                        Object content = entry.getValue();
                        if (JSONUtil.isJson(content.toString())) {
                            JSONObject contentJson = (JSONObject) content;
                            String keyValue = (String) contentJson.get("key");
                            //标题不需要替换，标题的key为空
                            if (StringUtils.isNotBlank(keyValue)) {
                                JSONObject fromJson = JSON.parseObject(formData);
                                String value = JSON.toJSONString(fromJson.get(keyValue));
                                if (type.equals("table")) {
                                    keySet.add(keyValue);
                                    if (keySet.size() > 1) {
                                        log.error("第{}行数据报错", k);
                                        throw new ApiBusinessException(Status.PRINT_TEMPLATE_CONFIGURE_COMPONENT_REPEAT_ERROR);
                                    }
                                    if (JSONUtil.isJsonArray(value)) {
                                        JSONArray jsonArray = JSON.parseArray(value);
                                        if (!CollectionUtils.isEmpty(jsonArray)) {
                                            if (JSONUtil.isJsonObj(jsonArray.get(0).toString())) {
                                                rowArrayDataMap.put(Integer.valueOf(k), jsonArray.size());
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return rowArrayDataMap;
    }

    /**
     * 对表单数据类型自动生成单元格
     *
     * @param rows
     * @param formData
     * @throws ApiBusinessException
     */
    public static void generateFormData(JSONObject rows, String formData) throws ApiBusinessException {
        Map<Integer, Integer> rowArrayDataMap = buildNeedAddRowMap(rows, formData);
        if (MapUtils.isNotEmpty(rowArrayDataMap)) {
            Map<Integer, Object> rowMap = buildRowMap(rows);
            int totalAddNum = 0;
            for (Map.Entry<Integer, Object> row : rowMap.entrySet()) {
                final int rowKey = row.getKey();
                Object rowJson = row.getValue();
                int addNum = 0;
                int curRow = 0;
                int addNumSize = 0;
                if (JSONUtil.isJson(rowJson.toString())) {
                    JSONObject rowJSONObject = (JSONObject) rowJson;
                    JSONObject cells = (JSONObject) rowJSONObject.get("cells");
                    if (cells != null) {
                        if (rowArrayDataMap.containsKey(rowKey)) {
                            addNumSize = rowArrayDataMap.get(rowKey);
                            //减去模板中存在的一行
                            addNum = addNumSize - 1;
                            //当动态增加行号后，后面的行号顺移
                            curRow = rowKey + totalAddNum;
                            totalAddNum += addNum;
                        }
                        updateNextRowNum(rows, addNum, curRow);
                        for (int i = 1; i < addNumSize; i++) {
                            rows.put(String.valueOf(curRow + i), JSON.parseObject(rowJson.toString()));
                        }
                    }
                }
            }
        }
    }

    private static Map<Integer, Object> buildRowMap(JSONObject rows) {
        Map<Integer, Object> rowMap = new TreeMap<>();
        for (Map.Entry<String, Object> row : rows.entrySet()) {
            final Integer rowKey = Integer.parseInt(row.getKey());
            Object rowJson = row.getValue();
            rowMap.put(rowKey, rowJson);
        }
        return rowMap;
    }

    /**
     * 构建每一行数据的key label关系
     *
     * @param rows
     * @return
     */
    private static Map<String, Queue<Map<String, String>>> buildRowLabelsMap(JSONObject rows) {
        Map<String, Queue<Map<String, String>>> rowLabelMap = new LinkedHashMap<>();
        Map<Integer, Object> rowMap = buildRowMap(rows);
        rowMap.forEach((k, v) -> {
            Queue<Map<String, String>> rowArrayLabels = new LinkedBlockingQueue<>();
            JSONObject row = (JSONObject) v;
            JSONObject cells = (JSONObject) row.get("cells");
            String type = row.get("type") != null ? row.get("type").toString() : "";
            if (cells != null) {
                String tableKeyValue = null;
                Map<String, String> labelMap = new LinkedHashMap<>();
                for (Map.Entry<String, Object> entry : cells.entrySet()) {
                    Object content = entry.getValue();
                    if (JSONUtil.isJson(content.toString())) {
                        JSONObject contentJson = (JSONObject) content;
                        String keyValue = (String) contentJson.get("key");
                        //标题不需要替换，标题的key为空
                        if (StringUtils.isNotBlank(keyValue)) {
                            String text = getSubUtil((String) contentJson.get("text"));
                            labelMap.put(text, "");
                            if (!type.equals("table")) {
                                rowArrayLabels.offer(labelMap);
                                rowLabelMap.put(k.toString().concat("_".concat(keyValue)), rowArrayLabels);
                            } else {
                                tableKeyValue = keyValue;
                            }
                        }
                    }
                }
                //表单行中只存在一个key
                if (type.equals("table") && MapUtils.isNotEmpty(labelMap)) {
                    rowArrayLabels.offer(labelMap);
                    if (StringUtils.isNotBlank(tableKeyValue)) {
                        rowLabelMap.put(k.toString().concat("_".concat(tableKeyValue)), rowArrayLabels);
                    }
                }
            }
        });
        return rowLabelMap;
    }

    /**
     * 更新生成行后面行的行号
     *
     * @param rows
     * @param addNum
     * @param curRow
     */
    private static void updateNextRowNum(JSONObject rows, int addNum, int curRow) {
        if (addNum > 0) {
            List<Integer> rowNums = new ArrayList<>();
            for (Map.Entry<String, Object> nextNode : rows.entrySet()) {
                final int nextKey = Integer.parseInt(nextNode.getKey());
                if (nextKey > curRow) {
                    rowNums.add(nextKey);
                }
            }
            rowNums.sort(Collections.reverseOrder());
            rowNums.forEach(each -> {
                Object object = rows.get(String.valueOf(each));
                rows.remove(String.valueOf(each));
                rows.put(String.valueOf(each + addNum), object);
            });
        }
    }

    public static void main(String[] args) throws ApiBusinessException {
        //String templateStr = "{\"name\":\"sheet1\",\"freeze\":\"A1\",\"styles\":[{\"align\":\"center\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\"}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":12}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":12}},{\"font\":{\"size\":12}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":12,\"name\":\"Helvetica\"}},{\"font\":{\"size\":12,\"name\":\"Helvetica\"}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":12,\"name\":\"Source Sans Pro\"}},{\"font\":{\"size\":12,\"name\":\"Source Sans Pro\"}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"name\":\"Source Sans Pro\"}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":12},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":16}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":16},\"valign\":\"middle\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":12}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":11},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":11}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":11,\"name\":\"Source Sans Pro\"}},{\"font\":{\"size\":11}},{\"font\":{\"size\":11,\"name\":\"Source Sans Pro\"}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":11}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"left\",\"font\":{\"size\":11}},{\"align\":\"left\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":11,\"name\":\"Source Sans Pro\"},\"align\":\"left\"},{\"font\":{\"size\":11},\"align\":\"left\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":11,\"name\":\"Source Sans Pro\"},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":11},\"align\":\"left\",\"valign\":\"top\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":11},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"font\":{\"size\":11},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":11},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":11},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":11},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":11,\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":11,\"name\":\"Source Sans Pro\",\"bold\":true}},{\"font\":{\"bold\":true}},{\"align\":\"center\",\"font\":{\"bold\":true}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":11,\"bold\":true}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":11,\"bold\":true}},{\"font\":{\"size\":11,\"bold\":true}},{\"font\":{\"size\":11,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":11,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":11,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":11,\"bold\":true},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":true}},{\"font\":{\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Source Sans Pro\"}},{\"font\":{\"size\":14,\"name\":\"Source Sans Pro\"}},{\"font\":{\"size\":14}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Source Sans Pro\"},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":14},\"align\":\"left\",\"valign\":\"top\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14,\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Source Sans Pro\",\"bold\":true}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14}},{\"font\":{\"bold\":true,\"size\":14}},{\"align\":\"center\",\"font\":{\"bold\":true,\"size\":14}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":14,\"bold\":true}},{\"font\":{\"size\":14,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":14,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":14,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":14,\"bold\":true},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":true,\"size\":14}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"top\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"top\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":14},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22,\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22,\"bold\":true},\"valign\":\"middle\"},{\"font\":{\"size\":14,\"name\":\"Source Sans Pro\",\"bold\":true}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14,\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Source Sans Pro\",\"bold\":true},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":14,\"bold\":true},\"align\":\"left\",\"valign\":\"top\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":22,\"bold\":false},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":14}},{\"font\":{\"bold\":false,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Source Sans Pro\",\"bold\":false}},{\"font\":{\"bold\":false}},{\"font\":{\"size\":14,\"bold\":false},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":14,\"bold\":false},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":14,\"bold\":false},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":14},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"bold\":false,\"size\":14}},{\"font\":{\"size\":14,\"name\":\"Source Sans Pro\",\"bold\":false}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Source Sans Pro\",\"bold\":false},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":14,\"bold\":false},\"align\":\"left\",\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":14,\"bold\":false}},{\"font\":{\"bold\":false,\"size\":14},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":14,\"bold\":false},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":false,\"size\":14}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":16,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16}},{\"font\":{\"bold\":false,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":16,\"name\":\"Source Sans Pro\",\"bold\":false}},{\"font\":{\"size\":16,\"bold\":false},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":16,\"bold\":false}},{\"font\":{\"bold\":false,\"size\":16},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":false,\"size\":16}},{\"align\":\"center\",\"font\":{\"name\":\"Source Sans Pro\",\"size\":16,\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16}},{\"font\":{\"bold\":true,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":16,\"name\":\"Source Sans Pro\",\"bold\":true}},{\"font\":{\"size\":16,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"align\":\"center\",\"font\":{\"size\":16,\"bold\":true}},{\"font\":{\"bold\":true,\"size\":16},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":true,\"size\":16}},{\"align\":\"center\",\"font\":{\"name\":\"Arial\",\"size\":16,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Arial\"}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Arial\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Arial\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Arial\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Arial\",\"size\":16,\"bold\":true},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Arial\"}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true,\"name\":\"Arial\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true,\"name\":\"Arial\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true,\"name\":\"Arial\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Arial\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Verdana\",\"size\":22,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Verdana\",\"size\":22,\"bold\":false},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Verdana\",\"size\":16,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Verdana\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Verdana\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Verdana\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Verdana\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"bold\":false,\"size\":14,\"name\":\"Verdana\"}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Verdana\",\"bold\":false}},{\"font\":{\"bold\":false,\"size\":14,\"name\":\"Verdana\"}},{\"align\":\"center\",\"font\":{\"name\":\"Verdana\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Verdana\",\"bold\":false},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":14,\"bold\":false,\"name\":\"Verdana\"},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Verdana\"},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":false,\"size\":16,\"name\":\"Verdana\"}},{\"align\":\"center\",\"font\":{\"name\":\"Courier New\",\"size\":22,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Courier New\",\"size\":22,\"bold\":false},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Courier New\",\"size\":16,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Courier New\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Courier New\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Courier New\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Courier New\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"bold\":false,\"size\":14,\"name\":\"Courier New\"}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Courier New\",\"bold\":false}},{\"font\":{\"bold\":false,\"size\":14,\"name\":\"Courier New\"}},{\"align\":\"center\",\"font\":{\"name\":\"Courier New\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Courier New\",\"bold\":false},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":14,\"bold\":false,\"name\":\"Courier New\"},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Courier New\"},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":false,\"size\":16,\"name\":\"Courier New\"}},{\"align\":\"center\",\"font\":{\"name\":\"Lato\",\"size\":22,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Lato\",\"size\":22,\"bold\":false},\"valign\":\"middle\"},{\"align\":\"center\",\"font\":{\"name\":\"Lato\",\"size\":16,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Lato\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Lato\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Lato\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"name\":\"Lato\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"center\",\"font\":{\"bold\":false,\"size\":14,\"name\":\"Lato\"}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Lato\",\"bold\":false}},{\"font\":{\"bold\":false,\"size\":14,\"name\":\"Lato\"}},{\"align\":\"center\",\"font\":{\"name\":\"Lato\",\"size\":14,\"bold\":false},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"valign\":\"top\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14,\"name\":\"Lato\",\"bold\":false},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"size\":14,\"bold\":false,\"name\":\"Lato\"},\"align\":\"left\",\"valign\":\"top\"},{\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"},\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":false,\"name\":\"Lato\"},\"align\":\"left\",\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"align\":\"left\",\"font\":{\"bold\":false,\"size\":16,\"name\":\"Lato\"}},{\"font\":{\"size\":16,\"bold\":true,\"name\":\"Lato\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true,\"name\":\"Lato\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"size\":16,\"bold\":true,\"name\":\"Lato\"},\"border\":{\"top\":[\"thin\",\"#000\"],\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"]}},{\"font\":{\"bold\":true,\"size\":16,\"name\":\"Lato\"},\"border\":{\"bottom\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"right\":[\"thin\",\"#000\"]}},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14},\"align\":\"center\"},{\"font\":{\"size\":14},\"align\":\"center\"},{\"border\":{\"bottom\":[\"thin\",\"#000\"],\"top\":[\"thin\",\"#000\"],\"left\":[\"thin\",\"#000\"],\"right\":[\"thin\",\"#000\"]},\"font\":{\"size\":14},\"align\":\"left\"},{\"font\":{\"size\":14},\"align\":\"left\"}],\"merges\":[\"A1:H1\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"B9:G9\",\"G11:H11\",\"G12:H12\",\"G13:H13\",\"G14:H14\",\"A2:B2\",\"A3:B3\",\"A4:B4\",\"A5:B5\",\"A6:B6\",\"A7:B7\",\"A8:B8\",\"A10:B10\",\"A11:B11\",\"A12:B12\",\"A13:B13\",\"A14:B14\",\"E6:H6\",\"E5:H5\",\"E3:H3\",\"G2:H2\",\"C4:H4\",\"C8:H8\",\"C7:H7\",\"C10:H10\",\"B9:G9\",\"B9:G9\",\"B15:G15\",\"B16:G16\"],\"rows\":{\"0\":{\"cells\":{\"0\":{\"text\":\"临时用电安全作业证\",\"key\":null,\"ri\":0,\"ci\":0,\"type\":\"\",\"merge\":[0,7],\"style\":195},\"1\":{\"style\":196,\"type\":\"\"},\"2\":{\"style\":196,\"type\":\"\"},\"3\":{\"style\":196,\"type\":\"\"},\"4\":{\"style\":196,\"type\":\"\"},\"5\":{\"style\":196,\"type\":\"\"},\"6\":{\"style\":196,\"type\":\"\"},\"7\":{\"style\":196,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":47},\"1\":{\"cells\":{\"0\":{\"text\":\"申请单位\",\"key\":null,\"ri\":1,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":199,\"type\":\"\",\"text\":\"${申请单位}\",\"key\":\"key_384BAE18-E91F-4653-AD20-5A06BBA506D2\",\"ri\":1,\"ci\":2},\"3\":{\"text\":\"申请人\",\"key\":null,\"ri\":1,\"ci\":3,\"type\":\"\",\"style\":197},\"4\":{\"style\":199,\"type\":\"\",\"text\":\"${申请人}\",\"key\":\"key_413F8CFD-016A-4CFF-A621-3576FBB9A15D\",\"ri\":1,\"ci\":4},\"5\":{\"text\":\"作业证编号\",\"key\":null,\"ri\":1,\"ci\":5,\"type\":\"\",\"style\":197},\"6\":{\"style\":199,\"type\":\"\",\"merge\":[0,1],\"text\":\"${作业证编号}\",\"key\":\"key_4FF75CB6-3D8F-4175-ABD1-0ECE88C27B20\",\"ri\":1,\"ci\":6},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":51},\"2\":{\"cells\":{\"0\":{\"text\":\"作业开始时间\",\"key\":null,\"ri\":2,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":199,\"type\":\"\",\"text\":\"${作业开始时间}\",\"key\":\"key_2EBD3AB3-7B2D-4882-BE43-894D60B2DC54\",\"ri\":2,\"ci\":2},\"3\":{\"text\":\"作业结束时间\",\"key\":null,\"ri\":2,\"ci\":3,\"type\":\"\",\"style\":197},\"4\":{\"text\":\"${作业结束时间}\",\"key\":\"key_9FC0405A-6F11-49CC-B755-96903C276CD9\",\"ri\":2,\"ci\":4,\"type\":\"\",\"style\":199,\"merge\":[0,3]},\"5\":{\"style\":198,\"type\":\"\"},\"6\":{\"style\":198,\"type\":\"\"},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":51},\"3\":{\"cells\":{\"0\":{\"text\":\"作业地点\",\"key\":null,\"ri\":3,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":199,\"type\":\"\",\"merge\":[0,5],\"text\":\"${作业地点}\",\"key\":\"key_1E5CF4A5-8E05-423C-A840-2B679664E5FB\",\"ri\":3,\"ci\":2},\"3\":{\"style\":198,\"type\":\"\"},\"4\":{\"style\":198,\"type\":\"\"},\"5\":{\"style\":198,\"type\":\"\"},\"6\":{\"style\":198,\"type\":\"\"},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":48},\"4\":{\"cells\":{\"0\":{\"text\":\"电源接入点\",\"key\":null,\"ri\":4,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":199,\"type\":\"\",\"text\":\"${电源接入点}\",\"key\":\"key_1FD6057B-345C-4E45-A4E0-1947DD14C8DB\",\"ri\":4,\"ci\":2},\"3\":{\"text\":\"工作电压\",\"key\":null,\"ri\":4,\"ci\":3,\"type\":\"\",\"style\":197},\"4\":{\"style\":199,\"type\":\"\",\"merge\":[0,3],\"text\":\"${工作电压}\",\"key\":\"key_A8E9F2E8-E78D-4D67-BEF0-946F6E6C7532\",\"ri\":4,\"ci\":4},\"5\":{\"style\":198,\"type\":\"\"},\"6\":{\"style\":198,\"type\":\"\"},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":49},\"5\":{\"cells\":{\"0\":{\"text\":\"用电设备及功率\",\"key\":null,\"ri\":5,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":199,\"type\":\"\",\"text\":\"${用电设备及功率}\",\"key\":\"key_435EE2EA-2BC9-4788-BE46-6AE0F21513CD\",\"ri\":5,\"ci\":2},\"3\":{\"text\":\"电工证号\",\"key\":null,\"ri\":5,\"ci\":3,\"type\":\"\",\"style\":197},\"4\":{\"style\":199,\"type\":\"\",\"merge\":[0,3],\"text\":\"${电工证号}\",\"key\":\"key_BA58A8CB-85B4-4140-AE1B-B715F0B26C29\",\"ri\":5,\"ci\":4},\"5\":{\"style\":198,\"type\":\"\"},\"6\":{\"style\":198,\"type\":\"\"},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":48},\"6\":{\"cells\":{\"0\":{\"text\":\"作业人\",\"key\":null,\"ri\":6,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":200,\"type\":\"\",\"text\":\"${作业人}\",\"key\":\"key_97DBCD17-C742-4850-AD46-AA629E9D87ED\",\"ri\":6,\"ci\":2,\"merge\":[0,5]},\"7\":{\"style\":222,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":50},\"7\":{\"cells\":{\"0\":{\"text\":\"危险辨识\",\"key\":null,\"ri\":7,\"ci\":0,\"type\":\"\",\"style\":197,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":203,\"type\":\"\",\"text\":\"${危险辨识}\",\"key\":\"key_4086D2D4-3FD1-49B7-ABFA-5FECC76072A8\",\"ri\":7,\"ci\":2,\"merge\":[0,5]},\"7\":{\"style\":222,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":79},\"8\":{\"cells\":{\"0\":{\"text\":\"序号\",\"key\":null,\"ri\":8,\"ci\":0,\"type\":\"\",\"style\":206},\"1\":{\"text\":\"安全措施\",\"key\":null,\"ri\":8,\"ci\":1,\"type\":\"\",\"style\":206,\"merge\":[0,5]},\"2\":{\"style\":207,\"type\":\"\"},\"3\":{\"style\":207,\"type\":\"\"},\"4\":{\"style\":207,\"type\":\"\"},\"5\":{\"style\":207,\"type\":\"\"},\"6\":{\"style\":207,\"type\":\"\"},\"7\":{\"style\":206,\"text\":\"确认人\",\"key\":null,\"ri\":8,\"ci\":7,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":51},\"9\":{\"cells\":{\"0\":{\"style\":197,\"type\":\"\",\"text\":\"实施安全教育人\",\"key\":null,\"ri\":19,\"ci\":0,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":200,\"type\":\"\",\"merge\":[0,5]}},\"type\":\"\",\"table_key\":null,\"height\":48},\"10\":{\"cells\":{\"0\":{\"style\":197,\"type\":\"\",\"text\":\"作业单位意见   \",\"key\":null,\"ri\":20,\"ci\":0,\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":201,\"type\":\"\"},\"3\":{\"style\":201,\"type\":\"\"},\"4\":{\"style\":201,\"type\":\"\",\"text\":\"签字\",\"key\":null,\"ri\":20,\"ci\":4},\"5\":{\"style\":201,\"type\":\"\"},\"6\":{\"style\":202,\"type\":\"\",\"text\":\"____年__月__日__时__分\",\"key\":null,\"ri\":20,\"ci\":6,\"merge\":[0,1]},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":48},\"11\":{\"cells\":{\"0\":{\"style\":197,\"text\":\"配送电单位意见\",\"key\":null,\"ri\":21,\"ci\":0,\"type\":\"\",\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":201,\"type\":\"\"},\"3\":{\"style\":201,\"type\":\"\"},\"4\":{\"style\":201,\"type\":\"\",\"text\":\"签字\",\"key\":null,\"ri\":20,\"ci\":4},\"5\":{\"style\":201,\"type\":\"\"},\"6\":{\"style\":202,\"text\":\"____年__月__日__时__分\",\"key\":null,\"ri\":21,\"ci\":6,\"type\":\"\",\"merge\":[0,1]},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":48},\"12\":{\"cells\":{\"0\":{\"style\":197,\"text\":\"审批部门意见\",\"key\":null,\"ri\":22,\"ci\":0,\"type\":\"\",\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":201,\"type\":\"\"},\"3\":{\"style\":201,\"type\":\"\"},\"4\":{\"style\":201,\"type\":\"\",\"text\":\"签字\",\"key\":null,\"ri\":20,\"ci\":4},\"5\":{\"style\":201,\"type\":\"\"},\"6\":{\"style\":202,\"text\":\"____年__月__日__时__分\",\"key\":null,\"ri\":22,\"ci\":6,\"type\":\"\",\"merge\":[0,1]},\"7\":{\"style\":198,\"type\":\"\"}},\"type\":\"\",\"table_key\":null,\"height\":47},\"13\":{\"cells\":{\"0\":{\"style\":197,\"text\":\"完工验收\",\"key\":null,\"ri\":23,\"ci\":0,\"type\":\"\",\"merge\":[0,1]},\"1\":{\"style\":198,\"type\":\"\"},\"2\":{\"style\":201,\"type\":\"\"},\"3\":{\"style\":201,\"type\":\"\"},\"4\":{\"style\":201,\"type\":\"\",\"text\":\"签字\",\"key\":null,\"ri\":20,\"ci\":4},\"5\":{\"style\":201,\"type\":\"\"},\"6\":{\"style\":214,\"text\":\"____年__月__日__时__分\",\"key\":null,\"ri\":23,\"ci\":6,\"type\":\"\",\"merge\":[0,1]},\"7\":{\"style\":215,\"type\":\"\"}},\"height\":48,\"type\":\"\",\"table_key\":null},\"14\":{\"cells\":{\"0\":{\"text\":\"序号\",\"key\":null,\"ri\":14,\"ci\":0,\"type\":\"\",\"style\":5},\"1\":{\"text\":\"安全措施\",\"key\":null,\"ri\":14,\"ci\":1,\"type\":\"\",\"merge\":[0,5],\"style\":5},\"7\":{\"text\":\"确认人\",\"key\":null,\"ri\":14,\"ci\":7,\"type\":\"\",\"style\":5}},\"type\":\"\",\"table_key\":null},\"15\":{\"cells\":{\"0\":{\"style\":5,\"text\":\"${序号}\",\"key\":\"key_8E9F4F31-95BA-47D5-8CEC-C6ACAA1B4B4C\",\"type\":\"table\",\"ri\":15,\"ci\":0},\"1\":{\"merge\":[0,5],\"style\":5,\"text\":\"${安全措施}\",\"key\":\"key_8E9F4F31-95BA-47D5-8CEC-C6ACAA1B4B4C\",\"type\":\"table\",\"ri\":15,\"ci\":1},\"7\":{\"style\":5,\"text\":\"${确认人}\",\"key\":\"key_8E9F4F31-95BA-47D5-8CEC-C6ACAA1B4B4C\",\"type\":\"table\",\"ri\":15,\"ci\":7}},\"type\":\"table\",\"table_key\":\"key_8E9F4F31-95BA-47D5-8CEC-C6ACAA1B4B4C\"}},\"cols\":{\"len\":26},\"validations\":[],\"autofilter\":{},\"rowLength\":50}";
        //String formData = "{\"key_120F269C-C520-4A40-A856-3EA9F302A23D\":\"______年___月___日___时___分\",\"code\":\"LD-20210909-0004\",\"enableAlarm\":[],\"key_61B04379-C887-4B5C-AEAD-119AD000E3BF\":{\"operator_signature\":[],\"guratee_signature\":[]},\"key_9C3E61DB-85A2-4E29-842F-1C650AF11643\":{\"operator_signature\":[],\"guratee_signature\":[]},\"key_2586D9F1-A4CD-4F36-A70C-F256A98613A3\":\"______年___月___日___时___分\",\"key_5B531FBE-510D-4D6A-B660-425EBD7E57D8\":{\"operator_signature\":[],\"guratee_signature\":[]},\"bizName\":\"临时用电（试用V1）\",\"key_413F8CFD-016A-4CFF-A621-3576FBB9A15D\":\"管理员\",\"key_2DAE1ED4-8A53-442E-8BD0-F7CA24F67956\":\"______年___月___日___时___分\",\"key_8E9F4F31-95BA-47D5-8CEC-C6ACAA1B4B4C\":[{\"序号\":\"1.\",\"安全措施\":\"安装临时线路人员持有电工作业操作证\"},{\"序号\":\"2.\",\"安全措施\":\"在防爆场所使用的临时电源、元器件和线路达到相应的防爆等级要求\"},{\"序号\":\"3.\",\"安全措施\":\"临时用电的单项和混用线路采用五线制\"},{\"序号\":\"4.\",\"安全措施\":\"临时用电线路在装置内不低于2.5m，道路不低于5m\"},{\"序号\":\"5.\",\"安全措施\":\"临时用电线路架空进线未采用裸线，未在树或脚手架上架设\"},{\"序号\":\"6.\",\"安全措施\":\"暗管埋设及地下电缆线路设有“走向标志”和“安全标志”，电缆埋深大于0.7m\"},{\"序号\":\"7.\",\"安全措施\":\"现场临时用配电盘、箱有防雨措施\"},{\"序号\":\"8.\",\"安全措施\":\"临时用电设施有漏电保护器，移动工具、手持工具“一机一闸保护”\"},{\"序号\":\"9.\",\"安全措施\":\"用电设备、线路容量、负荷符合要求\"},{\"序号\":\"10.\",\"安全措施\":\"其他安全措施\"}],\"state\":\"\",\"key_384BAE18-E91F-4653-AD20-5A06BBA506D2\":\"湖北宜化松滋肥业有限公司\",\"key_ED07F205-5AE4-4A8F-A2A1-F1B1C3EC4F3A\":\"______年___月___日___时___分\",\"key_09BA1EF1-E013-4472-BBE6-35F6AA70C3A2\":{\"operator_signature\":[],\"guratee_signature\":[]},\"status\":\"打印\",\"节点名称\":\"打印\"}";
        //System.out.println(printTemplateDataFill(templateStr, formData));
    }


    public static String findTaskFromDataValByKey(String key, String fromData) {
        if (!StringUtils.isEmpty(fromData)) {
            JSONObject fromJson = JSON.parseObject(fromData);
            Object obj = fromJson.get(key);
            if (obj != null) {
                if (!JSONUtil.isJsonObj(obj.toString()) && !JSONUtil.isJsonArray(obj.toString())) {
                    return (String) fromJson.get(key);
                }
            }
        }
        return null;
    }

    /**
     *  找到表格type为monitorPoint的special
     * @param formJsonStr
     * @return
     */
    public static String findObjectFormJsonComponentType(String formJsonStr , String key) {
        String special = "";
        if (StringUtils.isNotBlank(formJsonStr)) {
            JSONObject formJson = JSON.parseObject(formJsonStr);
            Object temArrObj = formJson.get(WorkFlowConstants.FROM_JSON_KEY_TEMARR);
            if (temArrObj != null) {
                JSONArray temArr = JSONObject.parseArray(temArrObj.toString());
                for (Object tem : temArr) {
                    Map<String, Object> tableMap = JSONObject.parseObject(JSON.toJSONString(tem));
                    Object column1 = tableMap.get(WorkFlowConstants.FROM_JSON_KEY_COLUMN1);
                    if (WorkFlowConstants.FROM_JSON_KEY_TABLE.equals(column1)) {
                        continue;
                    }
                    Object tableArrObj = tableMap.get(WorkFlowConstants.FROM_JSON_KEY_TABLEARR);
                    JSONArray tableArr = JSONObject.parseArray(tableArrObj.toString());
                    for (Object table : tableArr) {
                        Map<String, Object> beanMap = JSONObject.parseObject(JSON.toJSONString(table));
                        Object typeObj = beanMap.get(WorkFlowConstants.FROM_JSON_KEY_TYPE);
                        if (typeObj != null) {
                            String keyStr = beanMap.get(WorkFlowConstants.FROM_JSON_KEY_SELF).toString();
                            if (key.equals(keyStr)){
                                String value = (String) typeObj;
                                if ("monitorPoint".equals(value)) {
                                    special = beanMap.get(WorkFlowConstants.FROM_JSON_KEY_SPECIAL).toString();
                                }
                            }
                        }
                    }
                }
            }
        }
        return special;
    }


    /**
     * 从fromJson中找到对应key和对应lable的componentConfig
     * @param formJsonStr
     * @return
     */
    public static String findObjectFormJsonComponentType(String formJsonStr , String key , String lable) {
        String accessType = null;
        if (StringUtils.isNotBlank(formJsonStr)) {
            JSONObject formJson = JSON.parseObject(formJsonStr);
            Object temArrObj = formJson.get(WorkFlowConstants.FROM_JSON_KEY_TEMARR);
            if (temArrObj != null) {
                JSONArray temArr = JSONObject.parseArray(temArrObj.toString());
                for (Object tem : temArr) {
                    Map<String, Object> tableMap = JSONObject.parseObject(JSON.toJSONString(tem));
                    Object tableArrObj = tableMap.get(WorkFlowConstants.FROM_JSON_KEY_TABLEARR);
                    JSONArray tableArr = JSONObject.parseArray(tableArrObj.toString());
                    for (Object table : tableArr) {
                        Map<String, Object> beanMap = JSONObject.parseObject(JSON.toJSONString(table));
                        Object keyValue = beanMap.get(WorkFlowConstants.FROM_JSON_KEY_SELF);
                        if (keyValue.equals(key)){
                            Object columnList = tableMap.get(WorkFlowConstants.FROM_JSON_KEY_COLUMNLIST);
                            JSONArray columnArr = JSONObject.parseArray(columnList.toString());
                            for (Object column : columnArr) {
                                Map<String, Object> columnMap = JSONObject.parseObject(JSON.toJSONString(column));
                                String lableValue = (String)columnMap.get(WorkFlowConstants.FROM_JSON_KEY_LABEL);
                                if (lable.equals(lableValue)){
                                    String componentConfig = columnMap.get(WorkFlowConstants.FROM_JSON_KEY_COMPONENTCONFIG).toString();
                                    JSONObject componentConfigJson = JSON.parseObject(componentConfig);
                                    Object specialObject = componentConfigJson.get(WorkFlowConstants.FROM_JSON_KEY_SPECIAL);
                                    if (!ObjectUtils.isEmpty(specialObject)){
                                        String specialValue = specialObject.toString();
                                        JSONObject specialJsonObject = JSON.parseObject(specialValue);
                                        Object monitorePoint = specialJsonObject.get(WorkFlowConstants.FROM_JSON_KEY_MONITOREPOINT);
                                        if (!ObjectUtils.isEmpty(monitorePoint)){
                                            JSONObject moitorePointJson = JSON.parseObject(monitorePoint.toString());
                                            accessType = (String)moitorePointJson.get(WorkFlowConstants.FROM_JSON_KEY_ACCESSTYPE);
                                        }
                                    }
                                }
                            }

                        }
                        
                    }
                }
            }
        }
        return accessType;
    }

    /**
     * 从formdata中拿到前端需要的数据
     * @param value 原始数据
     * @param lable lable
     * @return
     */
    private static List<String> getLableValueFromData(String value , String lable){
        List<String> result = new ArrayList<>();
        if (StringUtils.isNotBlank(value)){
            JSONArray valueArrList = JSONArray.parseArray(value);
            for (Object valueArr : valueArrList) {
                JSONObject valueJson = JSONObject.parseObject(valueArr.toString());
                Object valueStr = valueJson.get(lable);
                if (null != valueStr){
                    result.add(valueStr.toString());
                }
            }
        }
        return result;
    }
}
